package com.class06.controller;

import com.class06.pojo.Student;
import com.class06.service.StudentService;

import java.util.List;

public class StudentController {

    private StudentService studentService;


    //    set方法主要用于ioc方式注入StudentService
    public void setStudentService(StudentService studentService) {
        this.studentService = studentService;
    }

    public List<Student> queryAllStudent() {
        List<Student> allStudent = studentService.getAllStudent();
        return allStudent;
    }


    public int addStudent(Student student) {
        return studentService.addStudent(student);
    }


//    删除学生信息
    public int deleteStudent(Integer id) {
        return studentService.deleteStudent(id);
    }

//    修改学生信息
    public int updateStudent(Student student) {
        return studentService.updateStudent(student);
    }
}
